// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "MyLoadingWidget.generated.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnGameLoadingComplete);

/**
 * 
 */
UCLASS()
class MYPROJECT2_API UMyLoadingWidget : public UUserWidget
{
	GENERATED_BODY()

	virtual void NativeConstruct() override;

	UPROPERTY(meta = (BindWidget))
	class UProgressBar* Hamster_Progress_Bar;

	UPROPERTY(meta = (BindWidget))
	class UImage* BackGround;

protected:
	FTimerHandle LoadingTimeHandle;
	float CurrentProgress;
	void UpdateProgressBar();
	
public:
	UPROPERTY(BlueprintAssignable, Category = "Events")
	FOnGameLoadingComplete GameLoadingComplete;

	UFUNCTION(BlueprintCallable, Category = "UI")
	void SetProgressBarValue(float Value);
	
private:
	void SetFullScreenImage(UTexture2D* backgroundTexture);
	
};
